let fs = require('fs');

let url = __dirname+'/3.txt';

const result = fs.statSync(url);
console.log(result.isFile());// 判断验证的地址是否是一个文件
console.log(result.isDirectory());// 判断是否为目录